//20071012: Eric Kao was created.
//這是有關的 CheckBox Util

//全選和取消全選, 使用 引數傳入
function doCheckBoxAll( formId, isAll )
{
    var objForm = document.forms[formId];
    var objLen = objForm.length;
    var flag;
    
    for( var iCount = 0 ; iCount < objLen ; iCount++ )
    {
        if( isAll )
        	flag = true;
        else
        	flag = false;
        	
        if( objForm.elements[iCount].type == "checkbox" )
        	objForm.elements[iCount].checked = flag;
    }
}

//全選和取消全選, 使用  checkBox
function doCheckBoxAllForCheckBox( formId, theCheckBox )
{
    var objForm = document.forms[formId];
    var objLen = objForm.length;
    var flag;
    
    for( var iCount = 0 ; iCount < objLen ; iCount++ )
    {
        if( theCheckBox.checked == true )
        	flag = true;
        else
        	flag = false;
        	
        if( objForm.elements[iCount].type == "checkbox" )
        	objForm.elements[iCount].checked = flag;
    }
}
